package com.zja.www.bean;


public class Result {
    private boolean success;
    private String message;
    private Object data;

    // 私有构造方法
    private Result(boolean success, String message, Object data) {
        this.success = success;
        this.message = message;
        this.data = data;
    }

    // 成功静态方法
    public static Result success(String message, Object data) {
        return new Result(true, message, data);
    }

    // 失败静态方法
    public static Result fail(String message) {
        return new Result(false, message, null);
    }

    // Getter 方法
    public boolean isSuccess() {
        return success;
    }

    public String getMessage() {
        return message;
    }

    public Object getData() {
        return data;
    }
}
